home *** CD-ROM | disk | FTP | other *** search
- /*
- File: PGEdge.h
-
- Contains: Active-edge structure for the clipper.
-
- Owned by: Jens Alfke (based on algorithm by A. C. Kilgour)
-
- Copyright: © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <2> 5/25/95 jpa List.h --> LinkList.h [1253324]
- <1> 6/15/94 jpa first checked in
- ---------------------------Moved to ODSOM project.
- <1> 5/9/94 jpa first checked in
-
- Theory of Operation:
- In Progress:
- */
-
- #ifndef _PGEDGE_
- #define _PGEDGE_
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- #ifndef _LINKLIST_
- #include "LinkList.h"
- #endif
-
- #ifndef _PGCOMMON_
- #include "PGCommon.h"
- #endif
-
-
- class PGVertex;
- class PGOutputContour;
-
-
- // PGEdge represents an edge in the Active Edge Table.
- class PGEdge :public Link
- {
- public:
- PGEdge( const PGVertex *tail, const PGVertex *head );
-
- PGSide TestPoint( const ODPoint& ); // Which side of line is pt on?
- ODBoolean IntersectWith( const PGEdge*, ODPoint § );
- PGEdge* ReplaceWithCopy( ); // Returns the copy
-
- void StartPath( PGEdge *rightEdge, const ODPoint* );
- void ExtendPath( PGEdge *lowerEdge, const ODPoint* );
- void MergePaths( PGEdge*, const ODPoint* );
-
- ODSShort fWrapNo; // Wrap-number of my contour
- PGSense const fSense; // kPositive if heading downward
- ODBoolean fLowEvent; // Has bottom been entered into event queue?
- ODBoolean fMatched; // Temp flag used in edge-matching
- ODBoolean fLeftBundle, // Bundled w/prev edge?
- fRightBundle; // Bundled w/next edge?
- const PGVertex *fHighVert, // Top (min. y) vertex
- *fLowVert; // Bottom (max. y) vertex
- ODPoint fDelta; // Dist from high to low vert. y >= 0!
-
- PGSide fSide; // Which side of output path?
- PGEdge *fOtherSide; // Edge on other side of output contour
- PGOutputContour *fOutput; // Output contour
- };
-
-
- class PGEdgeTable :public LinkedList
- {
- public:
- void Add( PGEdge* ); // Adds sorted
-
- void InsertListBefore( PGEdgeTable&, PGEdge *before );
- void AddRange( PGEdge *first, PGEdge *last, PGEdge *before );
- PGEdge* RemoveRange( PGEdge *first, PGEdge *last );
-
- void Unmatch( );
- PGEdge* FirstUnmatched( );
- PGEdge* LastUnmatched( );
- PGEdge* UnmatchedBefore( const PGEdge* );
- PGEdge* UnmatchedAfter( const PGEdge* );
- };
-
- #endif /*_PGEDGE_*/